<%@ page import="java.util.Random" %>
<%--
  Created by IntelliJ IDEA.
  User: Y
  Date: 2022/11/28
  Time: 19:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>随机点名</title>
</head>
<body>
<%--你好世界--%>
<!--我是一个html的注释-->
<%--jsp的注释并没有被Java编译，而html是被java编译了的--%>

<%
    //我是一个Java的单行注释
    String [] names = {"张三","李四","王五","赵六","田七"};
    Random random  = new Random();
    int index = random.nextInt(names.length);
%>
<h2>随机的姓名：
        <span style="color: aquamarine">
            <%=names[index]%>
        </span>
</h2>

</body>
</html>
